#pragma once
#include <osg/Vec3>
#include <osgText/Text>
#include <stdlib.h>
#include "MYModel.h"

using namespace std;
using namespace osg;

class GameLogic
{
private:

	set<Vec3>* fillCasesAdjacentes(float x, float y, set<Vec3>* v);
	set<Vec3>* canIStillWin(float x, float y, set<Vec3>* vp);
	//pattern singleton
	static GameLogic* instance;

public:
	
	// constante de direction
	static const int HAUT = 0, GAUCHE = 1, BAS = 2, DROITE = 3;
	// pattern singleton
	static GameLogic* getInstance();

	set<Vec3> getCasesAdjacentes(float x, float y);

	bool canCross(float fromX, float fromY, int direction);

	bool GameLogic::canIGoTo(float fromX,float fromY,float toX,float toY);

	bool GameLogic::isPawn(float x, float y);

	bool GameLogic::doesPawnJustWin(bool rouge);

	bool GameLogic::canIWallHere(float x, float y, int orientation);
	
	bool GameLogic::canIStillWin(bool rouge);

	GameLogic(void);
	~GameLogic(void);
};

